<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<style type="text/css">
body{ font: 12px/22px "Microsoft Yahei", "Consolas",Tahoma, Geneva, sans-serif;background-color: #f2f2f2;letter-spacing:1px;}
#content{margin: 50px auto;width: 650px; background-color: #FFFFFF; border-radius: 8px;border: 1px solid #dddddd;}
h2{font-size: 24px; color: #262626; margin: 40px 0 20px 40px;}
#message{ margin: 0 0 40px 40px; color:#999;}

#redirect{margin: 0 0 40px 0; padding: 18px 0 18px 40px;background-color: #faf9f9;border-top: 1px solid #f4f2f2;border-bottom: 1px solid #f4f2f2;}
#redirect a{color: #185787;}
#redirect em {color:red;}
</style>
</head>
<body>
<div id="content">
  <h2>An Error Was Encountered - 500</h2>
  <p id="message"><?php echo $message;?></p>
  <?php if($url):?>
  <p id="redirect">
      <img src="" align="absmiddle" />
      <em><?php echo $wait;?></em> 秒后自动跳转, 如果没有自动跳转请
      <a href="javascript:R();">Click here to go back</a>.
  </p>
  <?php endif;?>
</div>

<script type="text/javascript">
var $wait = <?php echo $wait;?>;
var R = function() {<?php if( isset($_SERVER['HTTP_REFERER'])&&$url==$_SERVER['HTTP_REFERER'] ) echo 'window.history.go(-1);'; elseif($url) echo "window.location.href=\"{$url}\"";?>}
if(document.getElementById("redirect")){
    var WD = function(){
        $wait--;
        if(!$wait) R();
        var $wt = document.getElementById("redirect").getElementsByTagName("em")[0].firstChild;
        $wt.nodeValue = $wait;
        setTimeout("WD()",1000);
    }
    setTimeout("WD()",1000);
}
</script>
</body>
</html>